<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	var base = "${base}/";
</script>
<!--框架必需-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${base}/scripts/framework.js"></script>
<link href="${base}/css/import_basic.css" rel="stylesheet" type="text/css" />
<link href="${base}/css/sky/style.css" rel="stylesheet" type="text/css" />
<!--时间控件-->
<script src="${base}/scripts/form/datePicker/WdatePicker.js" type="text/javascript"></script>
<!--表单验证脚本-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="${base}/js/verify-goods-add.js"></script>
</head>
<body>
	<div class="position">
		<div class="center">
			<div class="left">
				<div class="right">
					<span>当前位置：商品管理 >> 新增商品</span>
				</div>
			</div>
		</div>
	</div>
	<div class="box1" whiteBg="true">
		<form action="${base}/admin/goods/save.action" method="post" enctype="multipart/form-data" id="add_goods_form" target="frmright">
			<table class="tableStyle" transMode="true">
				<input type="hidden" name="goodsInfo.id" id="goodsInfo_id" class="text_style" value="${(goodsInfo.id)!''}"/>
				<tr>
					<td>商品编号：</td>
					<td>
						<input type="text" name="goodsInfo.goodsNo" id="goodsInof.goodsNo" class="text_style" />
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>商品名称：</td>
					<td>
						<input type="text" name="goodsInfo.goodsName" id="goodsInfo.goodsName" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>商品样图：</td>
					<td>
						<input type="file" name="upload" class="file" contenteditable="false"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>商品单位：</td>
					<td>
						<select name="unitType" id="unitType" class="selectbox" editable="true">
							<option value="盒">盒</option>
							<option value="支">支</option>
							<option value="瓶">瓶</option>
							<option value="份">份</option>
							<option value="盒">件</option>
						</select>
						<input type="hidden" name="goodsInfo.unitType" id="goodsInfo_unitType"/>
					</td>
				</tr>
				<tr>
					<td>成本价：</td>
					<td>
						<input type="number" name="goodsInfo.costPrice" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>批发价：</td>
					<td>
						<input type="number" name="goodsInfo.wholesalePrice" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>出售价：</td>
					<td>
						<input type="number" name="goodsInfo.unitPrice" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>抵押积分：</td>
					<td>
						<input type="number" name="goodsInfo.creditNum" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>库存量：</td>
					<td>
						<input type="number" name="goodsInfo.stock" class="text_style"/>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td>销售状态：</td>
					<td>
						<select name="goodsInfo.saleStatus" class="selectbox">
							<option value="0">可销售</option>
							<option value="1">不可销售</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>商品类别：</td>
					<td>
						<select name="goodsInfo.goodsCategoryId" class="selectbox">
							<#if goodsCategoryList??>
							<#list goodsCategoryList as category>
								<option value="${(category.id)!0}">${(category.categoryName)!''}</option>
							</#list>
							</#if>
						</select>
					</td>
				</tr>
				<tr>
					<td>供应商：</td>
					<td>
						<select name="goodsInfo.merchantId" class="selectbox">
							<#if merchantList??>
							<#list merchantList as merchant>
								<option value="${(merchant.id)!0}">${(merchant.merchantName)!''}</option>
							</#list>
							</#if>
						</select>
					</td>
				</tr>
				<tr>
					<td>有效期：</td>
					<td>
						<input type="text" style="width:150px;" name="goodsInfo.expireDate" class="date text_style" dateFmt="yyyy-MM-dd HH:mm:ss" />
					</td>
				</tr>
				<tr>
					<td>商品规格：</td>
					<td>
						<textarea name="goodsInfo.specification" style="width: 200px;" class="textarea_style"></textarea>
						<span class="star">*</span>
						<span class="verror"></span>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<input type="submit" class="button" value="提 交 " />
						<input type="reset" class="button" value="重 置 " />
						<input type="button" class="button" onclick="top.Dialog.close()" value="取消" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
<script>
$(function() {
	$("#2_input").blur(function() {
		$("#goodsInfo_unitType").val($("#unitType").attr("editValue"));
	});
	$("#2_container").children("ul").click(function() {
		$("#goodsInfo_unitType").val($("#unitType").attr("editValue"));
	});
});
</script>